]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
search: Do not unregister a provider that was not registered
authorhtrex <hantarex@gmail.com>
Wed, 29 Jul 2026 09:51:52 +0000 (11:51 +0200)
committerFlorian Müllner <fmuellner@gnome.org>
Sun, 2 Aug 2026 16:54:33 +0000 (18:54 +0200)
If the passed provider is not in this._providers, indexOf() returns -1 and
splice(-1, 1) silently removes the LAST provider in the array - an arbitrary,
unrelated provider.

Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/work_items/9317
Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/4308>
(cherry picked from commit a4c7d5e60e4f0982f7dfa048b7400eb4fdf2f97e)

js/ui/search.js

index 9ded1418490a9afea232eb05d902406d10c1fc0d..88965bfb61a69716bec4204d99ddadbd4d2e9310 100644 (file)
@@ -670,6 +670,9 @@ export const SearchResultsView = GObject.registerClass({
 
     _unregisterProvider(provider) {
         const index = this._providers.indexOf(provider);
+        if (index < 0)
+            return;
+
         this._providers.splice(index, 1);
 
         if (provider.display)